package com.zzxy.vcs.controller;

import com.sun.xml.internal.ws.api.server.Module;
import com.zzxy.vcs.ext.UserExt;
import com.zzxy.vcs.po.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import sun.security.pkcs11.Secmod;

import javax.xml.ws.RequestWrapper;

@Controller
@RequestMapping("/user")

public class UserAnnoController {
    @RequestMapping("/test")
    public String test(){
        return "redirect:list.do";
    }
    @RequestMapping("/list")
    public String list(Model model){
        model.addAttribute("username","zhangwuji");
        return "/user/userList";
    }
    @RequestMapping("toRegister")

    public  String toRegister(){
        return "/user/register";
    }

    @RequestMapping("register")
    public String addUser(User user, Model model){
        model.addAttribute("user",user);
        System.out.println(user);
        return "/user/userList";
    }
    @RequestMapping("register1")
    public String addUser1(UserExt ext, Model model){
        model.addAttribute("userext",ext);
        System.out.println(ext);
        return "/user/userList";
    }


}
